home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Utilities / vim-5.1 / syntax / css.vim < prev    next >
Encoding:
Text File  |  1998-03-30  |  5.0 KB  |  106 lines

  1. " Vim syntax file
  2. " Language:    Cascading Style Sheets
  3. " Maintainer:    Claudio Fleiner <claudio@fleiner.com>
  4. " URL:        http://www.fleiner.com/vim/syntax/css.vim
  5. " Last change:    1998 Mar 28
  6.  
  7. " Remove any old syntax stuff hanging around
  8. syn clear
  9. syn case ignore
  10.  
  11. syn keyword cssTagName address applet area a base basefont
  12. syn keyword cssTagName big blockquote body br b caption center
  13. syn keyword cssTagName cite code dd dfn dir div dl dt em font
  14. syn keyword cssTagName form h1 h2 h3 h4 h5 h6 head hr html img
  15. syn keyword cssTagName input isindex i kbd link li link map menu
  16. syn keyword cssTagName meta ol option param pre p samp 
  17. syn keyword cssTagName select small span strike strong style sub sup
  18. syn keyword cssTagName table td textarea th title tr tt ul u var
  19.  
  20. syn match cssIdentifier "#[a-zA-Z][a-zA-Z0-9-]*"
  21.  
  22. syn match cssLength contained "[-+]\=[0-9]\+\(\.[0-9]*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\)\="
  23. syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow 
  24. syn match cssColor contained "white"
  25. syn match cssColor contained "\(#[0-9A-Fa-f]\{3\}\>\|#[0-9A-Fa-f]\{6\}\>\|rgb\s*(\s*[0-9]\+\(\.[0-9]*\)\=%\=\s*,\s*[0-9]\+\(\.[0-9]*\)\=%\=\s*,\s*[0-9]\+\(\.[0-9]*\)\=%\=\s*)\)"
  26. syn match cssURL contained "\<url\s*([^)]*)"ms=s+4,me=e-1
  27.  
  28. syn match cssImportant contained "!\s*important\>"
  29.  
  30. syn match cssFontProperties contained "\<font\>\(-\(family\|style\|variant\|weight\|size\)\)\="
  31. syn keyword cssFontProperties contained xyz
  32. syn keyword cssFontAttr contained cursive fantasy monospace normal italic oblique
  33. syn keyword cssFontAttr contained bold bolder lighter medium larger smaller
  34. syn match cssFontAttr contained "\<\(sans\>-\)\=\<serif\>"
  35. syn match cssFontAttr contained "\<small-caps\>"
  36. syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(\<small\>\|\<large\>\)\>"
  37.  
  38. syn match cssColorProperties contained "\<color\>"
  39. syn match cssColorProperties contained "\<background\>\(-\(color\|image\|repeat\|attachment\|position\)\>\)\="
  40. syn keyword cssColorAttr contained transparent none top center bottom left right scroll fixed
  41. syn match cssColorAttr contained "\<\(repeat\|repeat-x\|repeat-y\|no-repeat\)\>"
  42.  
  43.  
  44. syn match cssTextProperties contained "\<\(word-spacing\|letter-spacing\|text-decoration\|vertical-align\|text-transform\|text-align\|text-indent\|line-height\)\>"
  45. syn keyword cssTextAttr contained normal none underline overline blink sub super middle
  46. syn keyword cssTextAttr contained capitalize uppercase lowercase none left right center justify
  47. syn match cssTextAttr contained "\<line-through\>"
  48. syn match cssTextAttr contained "\<\(text-\)\=\<\(top\|bottom\)\>" 
  49.  
  50. syn match cssBoxProperties contained "\<margin\>\(-\(top\|right\|bottom\|left\)\>\)\="
  51. syn match cssBoxProperties contained "\<padding\>\(-\(top\|right\|bottom\|left\)\>\)\="
  52. syn match cssBoxProperties contained "\<border\>\(-\(top\|right\|bottom\|left\)\>\)\=\(-width\>\)\="
  53. syn match cssBoxProperties contained "\<border-color\>"
  54. syn match cssBoxProperties contained "\<border-style\>"
  55. syn keyword cssBoxProperties contained width height float clear
  56. syn keyword cssBoxAttr contained auto thin medium thick left right none both
  57. syn keyword cssBoxAttr contained none dotted dashed solid double groove ridge inset outset
  58.  
  59. syn keyword cssClassificationProperties contained display 
  60. syn match cssClassificationProperties contained "\<white-space\>"
  61. syn match cssClassificationProperties contained "\<list-\(item\|style\(-\(type\|image\|position\)\)\=\)\>"
  62. syn keyword cssClassificationAttr contained block inline none normal pre nowrap
  63. syn keyword cssClassificationAttr contained disc circle square decimal none
  64. syn match cssClassificationAttr contained "\<list-item\>"
  65. syn match cssClassificationAttr contained "\<\(lower\|upper\)-\(roman\|alpha\)\>"
  66.  
  67. syn region cssInclude start="@import" end=";" contains=cssComment,cssURL
  68. syn match cssBraces contained "[{}]"
  69. syn match cssError contained "{@<>"
  70. syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Properties,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError
  71.  
  72. syn match cssPseudoClass transparent ":\S*" contains=cssPseudoClassId
  73. syn keyword cssPseudoClassId contained link visited active
  74. syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>"
  75.  
  76. syn region cssComment start="/\*" end="\*/"
  77. syn match cssComment "//.*$"
  78.  
  79. syn sync minlines=10
  80.  
  81. if !exists("did_css_syntax_inits")
  82.   hi link cssComment Comment
  83.   hi link cssTagName Statement
  84.   hi link cssFontProperties StorageClass
  85.   hi link cssColorProperties StorageClass
  86.   hi link cssTextProperties StorageClass
  87.   hi link cssBoxProperties StorageClass
  88.   hi link cssClassificationProperties StorageClass
  89.   hi link cssFontAttr Type
  90.   hi link cssColorAttr Type
  91.   hi link cssTextAttr Type
  92.   hi link cssBoxAttr Type
  93.   hi link cssClassificationAttr Type
  94.   hi link cssPseudoClassId PreProc
  95.   hi link cssLength Number
  96.   hi link cssColor Constant
  97.   hi link cssURL String
  98.   hi link cssIdentifier Function
  99.   hi link cssInclude Include
  100.   hi link cssImportant Special
  101.   hi link cssBraces Function
  102.   hi link cssError Error
  103. let b:current_syntax = "html"
  104.  
  105. " vim: ts=8
  106.